$(function () {
	
	var shophosts=$("input[name='shophosts']").val();
    
	$('input').iCheck({
      checkboxClass: 'icheckbox_square-blue',
      radioClass: 'iradio_square-blue',
      increaseArea: '20%'
    });
    $('form').bootstrapValidator({
        message: 'This value is not valid',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            username: {
                validators: {
                    notEmpty: {
                        message: '登录用户不能为空'
                    }
                }
            },
            checkcode: {
                validators: {
                	notEmpty : {
						message : '验证码不能为空'
					},
					stringLength : {
						min : 5,
						max : 5,
						message : '验证码输入有误'
					}
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: '密码不能为空'
                    }
                }
            },
            
        },
        submitHandler: function (validator, form, submitButton) {
            alert("submit");
        }
    });
    $("#checkimg").click(function(){
    	var date=new Date();
    	$(this).attr("src",shophosts+"/getcaptcha?a="+date.getTime())
    });
 });